using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.DataModel.Models.Mapping
{
    public class VoltageValueMap : EntityTypeConfiguration<VoltageValue>
    {
        public VoltageValueMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, VoltageValue1 = t.VoltageValue1 });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.VoltageValue1)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("VoltageValues");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.VoltageValue1).HasColumnName("VoltageValue");

           
        }
    }
}
